load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")
load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest")

oncall("fboss_platform")

cpp_library(
    name = "utils",
    srcs = [
        "TestUtils.cpp",
    ],
    exported_deps = [
        "//fboss/platform/sensor_service:service",
        "//folly:file_util",
        "//folly/testing:test_util",
    ],
)

cpp_unittest(
    name = "sensor_service_sw_test",
    srcs = [
        "SensorServiceImplTest.cpp",
        "SensorServiceThriftHandlerTest.cpp",
    ],
    deps = [
        ":utils",
        "//fb303:service_data",
        "//fboss/platform/sensor_service:core",
        "//fboss/platform/sensor_service:service",
        "//fboss/platform/sensor_service:utils",
        "//folly:file_util",
        "//folly/testing:test_util",
        "//thrift/lib/cpp2/protocol:protocol",
    ],
)

cpp_unittest(
    name = "utils_tests",
    srcs = [
        "UtilsTest.cpp",
    ],
    deps = [
        "fbsource//third-party/googletest:gmock",
        "//fboss/platform/sensor_service:utils",
    ],
)

cpp_unittest(
    name = "config_validator_test",
    srcs = [
        "ConfigValidatorTest.cpp",
    ],
    deps = [
        "//fboss/platform/sensor_service:config_validator",
    ],
)

cpp_unittest(
    name = "sensor_service_asic_temp_test",
    srcs = [
        "SensorServiceImplAsicTempTest.cpp",
    ],
    deps = [
        "fbsource//third-party/googletest:gmock",
        "//fb303:service_data",
        "//fboss/platform/helpers:mock_platform_utils",
        "//fboss/platform/sensor_service:service",
        "//fboss/platform/sensor_service:utils",
    ],
)

cpp_unittest(
    name = "sensor_service_power_consumption_test",
    srcs = [
        "SensorServiceImplPowerConsumptionTest.cpp",
    ],
    deps = [
        "//fb303:service_data",
        "//fboss/platform/sensor_service:service",
        "//folly:file_util",
    ],
)

cpp_unittest(
    name = "sensor_service_temperature_test",
    srcs = [
        "SensorServiceImplTemperatureTest.cpp",
    ],
    deps = [
        "//fb303:service_data",
        "//fboss/platform/sensor_service:service",
        "//folly:file_util",
    ],
)

cpp_unittest(
    name = "sensor_service_input_voltage_test",
    srcs = [
        "SensorServiceImplInputVoltageTest.cpp",
    ],
    deps = [
        "//fb303:service_data",
        "//fboss/platform/sensor_service:service",
        "//folly:file_util",
    ],
)
